

<template>
  <div class="app-container">

    <div id="divSearch" ref="divSearch">
      <el-form :inline="true" :model="Search" class="demo-form-inline">
        <el-form-item label="日期" prop="Search">

          <el-date-picker v-model="Search.CreatedOn"
                          type="daterange"
                          start-placeholder="开始日期"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          end-placeholder="结束日期"
                          :default-time="['00:00:00', '00:00:00']" />

        </el-form-item>
        <el-form-item label="编号" prop="Search">

          <el-input v-model.trim="Search.RecruitersAppyNo" placeholder="编号" />




        </el-form-item>
        <el-form-item>
			    <el-button type="primary" icon="el-icon-search" size="mini" @click="getDataList">查询</el-button>
       <el-button
            type="warning"
            icon="el-icon-circle-plus-outline"
            @click="FunRecruitersAdd"
            size="mini"
          >添加</el-button>
        

        </el-form-item>
      </el-form>
    </div>

    <el-table
      :data="DataList"
      :height="tableHeight"
      style="width: 100%;margin-top: 10px;"
      border
      @selection-change="handleSelectionChange"
      @sort-change="sortChange"
     >
 <el-table-column type="selection" label="选择" align="center" width="55"></el-table-column>
      <el-table-column align="center" label="编号">
            <template slot-scope="scope">{{ scope.row.RecruitersAppyNo }}</template>
          </el-table-column>
       
         <el-table-column align="center" label="部门">
              <template slot-scope="scope">{{ scope.row.Organizename }}</template>
            </el-table-column>
        
    
        

            <el-table-column align="center" label="工号">
              <template slot-scope="scope">{{ scope.row.UserCode }}</template>
            </el-table-column>

            <el-table-column align="center" label="姓名">
              <template slot-scope="scope">{{ scope.row.UserName }}</template>
            </el-table-column>

           

          <el-table-column align="center" label="聘用日期">
              <template slot-scope="scope">{{ scope.row.JoinedDate }}</template>
            </el-table-column>
           

            <el-table-column align="center" label="离职日期">
              <template slot-scope="scope">{{ scope.row.LeaveDate }}</template>
            </el-table-column>

            <el-table-column align="center" label="职位">
              <template slot-scope="scope">{{ scope.row.JobName }}</template>
            </el-table-column>

             <el-table-column align="center" label="级别">
              <template slot-scope="scope">{{ scope.row.JobLevel }}</template>
            </el-table-column>


          
        

          
            <el-table-column align="center" label="备注">
              <template slot-scope="scope">{{ scope.row.Remark1 }}</template>
            </el-table-column>
         

    </el-table>
    <el-pagination background
                   layout="sizes, prev, pager, next,total"
                   :page-size="Search.pageSize"
                   :total="Search.total"
                   @current-change="pageChange" />



  
  </div>




</template>

<script>
  import path from 'path'
  import { deepClone } from '@/utils'
  import { getDataList, updateForm, DeleteForm } from '@/api/RecruitersForm'

  // 默认的编辑字段
  const defaultObject = {

  }


  export default {
       name: "DataList",
  props: {
    ParmType: String,
    required: true,
  },

    data() {
      return {
         tableHeight: (() =>
        document.documentElement.clientHeight > 368 ? 300 : 368)(),
          tableHeight1: 400,
        EditObj: [],
        DataListCost: [],
        multipleTable:[],
        DataList: [],//队列的列表 在el-table中用
        dialogVisible: false,
        Search: {// 查询条件
          total: 0, // 总记录数
          pageSize: 10, // 一页显示的记录数
          page: 1, // /当前页码
          RNO: '008', // 表编号  根据Controller中对应的表编号
          jsWhere: ''// 自定义条件
        }
      }
    },
    computed: {
      routesData() {
        return this.routes
      }
    },
    created() {
      // Mock: get all routes and roles list from server

      this.getDataList()
    },
    methods: {
      pageChange(page) { // 翻页
        this.Search.page = page

        this.getDataList()
      },
      async getDataList() { // 获取列表数据，通用
        const res = await getDataList({ data: JSON.stringify(this.Search) })

        this.DataList = res.data.Table //将data 中的数据放到DataList中
        this.Search.total = res.data.Table1[0].RecordCount
        
      },
      sortChange: function (column) {
        // column, prop, order,排序，通用
        
        this.Search.sort = column.prop + ' ' + column.order

        this.getDataList()
      },
      handleSelectionChange(val) {
      this.multipleTable = val;
    },
      FunRecruitersAdd() {
      this.$emit(
        "FunRecruitersAdd",
        this.multipleTable,
        this.ParmType
      );
    }
    

    }
  }</script>

<style lang="scss" scoped>
  .app-container {
    .EditObjs-table

  {
    margin-top: 30px;
  }

  .permission-tree {
    margin-bottom: 5px;
  }
  }
</style>
